1. Field of the Invention
The present invention relates to a method of controlling a disk cache, and more particularly to a method of controlling a disk cache to recover and continue memory data processing without loss of data when a cache memory suffers a failure.
2. Description of the Related Art
It is the general practice to use disk caches to increase speeds at which to access magnetic disks (hereinafter also referred to as disks).
In order to speed up a data writing process with a disk cache, a FAST WRITE process has also been frequently carried out by reporting an end of data storage to a preceding stage when the storage of data into the disk cache comes to an end and updating data on the disk at a later time. According to the FAST WRITE process, since an end of data storage is reported to the preceding stage when data to be written which has been delivered from the preceding stage is stored into the disk cache, backup data may be simultaneously generated, making a dual data system, so as to prevent non-updated data from being eliminated due to a fault before being written on the disk. With the dual data system, when one data system fails to operate, memory data processing is continued either by a degenerated arrangement with the other data system or by interrupting the FAST WRITE process for maintaining reliability.
FIG. 1(a) of the accompanying drawings schematically illustrates a conventional method of controlling a disc cache to make disc cache data triple with two memory modules MM#1, MM#2. In FIG. 1(a), the memory modules MM#1, MM#2 store non-updated data (hereinafter also referred to as dirty data) 111, 121 written on the memory modules according to a FAST WRITE command from a preceding stage, data 112, 122 (hereinafter referred to as backup data) for backing up the dirty data which have been written in the other memory modules, and data 113, 123 (hereinafter referred to as clean data) that are in conformity with data recorded on a disk. When a FAST WRITE command is issued from the preceding stage, data is written as dirty data in one of the memory modules and as backup data in the other memory module. When data is read from the disk, the data is stored as clean data in either one of the memory modules, and is not made dual. If one of the memory modules cannot be used due to a failure, then the dirty data and the backup data which have been stored in the other memory module are handled as dirty data, thus assuring all the non-updated data. Though the clean data stored in the memory module which is no longer usable due to the failure is eliminated, when the preceding stage is about to read the clean data, data is read from the disk again, and stored as clean data into the memory module which can be used. According to this method, no data loss occurs owing to a memory module fault, but no redundancy is available with respect to the non-updated data because of a failure of one of the memory modules.
FIG. 1b) illustrates a conventional method of controlling a disc cache to make disc cache data fully dual with two memory modules MM#1, MM#2. In FIG. 1b), the memory modules MM#1, MM#2 store dirty data 111 and backup data 122, respectively, and clean data 113, 123, respectively, that are in conformity with data recorded on a disk. When a FAST WRITE command is issued from a preceding stage, data is written as dirty data in one of the memory modules and as backup data in the other memory module. When data is read from the disk, the same operation as above is performed, making clean data dual. According to this method, if one of the memory modules suffers a failure, only the usable memory module is used to continue memory data processing. In this case, only half the memory capacity that is installed can be used under normal conditions.
A first problem with the conventional methods of controlling a disk cache is that if the cache memory data is made fully dual, the cost is high because there is required a memory capacity that is twice the capacity of the cache memory that is used.
A second problem is that even if cache memory data is made dual to provide redundancy, such redundancy will be lost when one of the memory modules fails, and the occurrence of a new failure will make the disk cache system unstable with possible loss of data. Therefore, after redundancy has been lost due to a failure, the user needs to select one of two alternatives, i.e., using the disk cache system in favor of performance knowing that the data may possible be lost upon occurrence of a new failure, and interrupting the FAST WRITE process in favor of reliability.
Recent years have seen a RAID (Redundant Arrays of Independent Disks) system which comprises a combination of plural physical disks. A RAID-5 disk system which has a disadvantage referred to as write penalty suffers a drop in performance when a FAST WRITE process is interrupted for reliability and an end of data writing is not reported to a preceding stage until the writing of data onto a disk is ended.
Briefly, the RAID system is a disk system which is viewed as a single disk from a preceding stage, but actually comprises a plurality of physical disks for storing distributed data with added redundant data. Several levels are defined for the RAID system. According to the RAID-5 level, data are stored in the disks by sector striping.
For example, as shown in FIG. 2 of the accompanying drawings, when 2048 bytes of data are sent from a preceding stage to a RAID system which comprises four physical disks each having a sector length of 512 bytes, the 2048 bytes of data are divided into as many blocks as an integral multiple of the sector length, and the blocks are distributed to different disks and written with parity data on those disks. In the example shown in FIG. 2, divided blocks of data A, B, C are distributed and written on three disks, and parity data A-C for the horizontally aligned blocks A, B, C of data (as viewed in FIG. 2) across those three disks is written on the remaining one disk. It is necessary that parity data should be written on one disk to hold parity for the horizontally aligned blocks across the other three disks. Therefore, when a block D of data is written on one disk, parity data D-f needs to be updated in order to maintain consistency, according to either one of the following processes:
(1) Data e, f are read, parity data D-f is calculated from the data e, f, D, and the parity data D-f is written.
(2) Data d and parity data d-f which are present before the data D is written are read, the data d, the parity data d-f, (the data d and the parity data d-f), and the data D are exclusive-ORed into parity data D-f, and the parity data D-f is written.
According to these processes, in order to write the data D, it is necessary to update the parity data by reading data on the disks, regenerating parity data using the read data, and writing the parity data. Consequently, in order to write data whose size is smaller than a horizontal array of blocks, data needs to be read once from the disks, resulting in a processing time which is at least twice the time required to simply write data on the disks. Such a problem is referred to as write penalty and inherent in the RAID-5 level. This problem can be solved by the FAST WRITE process, which reports an end of data storage when the data D is stored in a cache memory and executes time-consuming disk accessing asynchronously with a host I/O. However, the FAST WRITE process is disadvantageous in that since an end of data storage is reported to a preceding stage before data is written on a disk, the data will be lost if a memory fault occurs before the data is actually written on the disk.